#ifndef LOADDOMAINQUERYTASK_H
#define LOADDOMAINQUERYTASK_H

//#include <QObject>
//#include <QThreadPool>
#include "publicstruct.h"

class LoadDomainQueryTask : public QObject
{
    Q_OBJECT
public:
    explicit LoadDomainQueryTask(const QVector<SocketDnInfo> &vsdi,QObject *parent = nullptr);
    ~LoadDomainQueryTask();
    QThreadPool threadPool;
public slots:
    void run();
    void stopThread();

signals:
    void started();
    void progress(int current, int total);
    void result(QByteArray data,QString reqParam);
    void taskInterrupt();
    void taskFinish();
    void finishedTask();

private:
    // 加载代理列表的逻辑
    QVector<QString> loadProxyList();
    // 分批验证代理
    void batchQueryDomain(const QVector<SocketDnInfo>& domainStrs);
    bool m_stopThread;
    QVector<SocketDnInfo> m_allDoman;
};

#endif // LOADDOMAINQUERYTASK_H
